
import threading
from crawler.query_weibo import query_dynamic

class WeiboThread(threading.Thread):

    def __init__(self,thread_id,queue):
        threading.Thread.__init__(self)
        self.thread_id = thread_id
        self.queue = queue
    
    def run(self):
        self.crawl_spider()

    def crawl_spider(self):
        while True:
            if self.queue.empty():
                break
            else:
                uid = self.queue.get()
                query_dynamic(uid)